// 普通船舶工序能源数据采集

/***************************工序及子工序***************************/
// 提交时自动带入的信息
export const commonColumns = [
  {
    title: "填写日期",
    dataIndex: "submitTime",
    key: "submitTime",
  },
  {
    title: "车间",
    dataIndex: "room",
    key: "room",
  },
];

// 工序一级Table
export const workColumns = {
  0: [
    ...commonColumns,
    {
      title: "钢板重量(吨)",
      dataIndex: "weight",
      key: "weight",
    },
    {
      title: "单船下料钢板重量(吨)",
      dataIndex: "shipWeight",
      key: "shipWeight",
    },
    {
      title: "使用电量",
      dataIndex: "powers", // 根据子表关联电表及时间段动态计算
      key: "powers",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位用电量",
      dataIndex: "powersByUnit", //动态计算 powers/weight
      key: "powersByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单船下料用电量",
      dataIndex: "shipPowers", //动态计算 powers/(shipWeight*weight)
      key: "shipPowers",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗氧气量标定值",
      dataIndex: "o2ByUnit", //动态计算 固定值
      key: "o2ByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "耗氧气量(m³)",
      dataIndex: "o2", // 动态计算 weight*o2ByUnit
      key: "o2",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位压缩空气标定值",
      dataIndex: "airByUnit", //动态计算 固定值
      key: "airByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "耗压缩空气量(m³)",
      dataIndex: "air", // 动态计算 weight*airByUnit
      key: "air",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  1: [
    ...commonColumns,
    {
      title: "部件",
      dataIndex: "type",
      key: "type",
    },
    {
      title: "厚(mm)",
      dataIndex: "thickness",
      key: "thickness",
    },
    {
      title: "宽(mm)",
      dataIndex: "width",
      key: "width",
    },
    {
      title: "数量",
      dataIndex: "num",
      key: "num",
    },
    {
      title: "长(mm)",
      dataIndex: "length",
      key: "length",
    },
    {
      title: "切割总长(mm)",
      dataIndex: "totalLength", //动态计算 (length+width)/1000*num
      key: "totalLength",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗氧气量标定值",
      dataIndex: "o2ByUnit", //动态计算 固定值
      key: "o2ByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "耗氧气量(m³)",
      dataIndex: "o2", // 动态计算 totalLength*o2ByUnit
      key: "o2",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗天然气标定值",
      dataIndex: "gasByUnit", //动态计算 固定值
      key: "gasByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "耗天然气(m³)",
      dataIndex: "gas", // 动态计算 totalLength*gasByUnit
      key: "gas",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  2: [
    ...commonColumns,
    {
      title: "类别",
      dataIndex: "weldType",
      key: "weldType", // 船体焊接/内场焊接
    },
    {
      title: "部件",
      dataIndex: "boardType",
      key: "boardType",
    },
    {
      title: "厚(mm)",
      dataIndex: "thickness",
      key: "thickness",
    },
    {
      title: "宽(mm)",
      dataIndex: "width",
      key: "width",
    },
    {
      title: "数量",
      dataIndex: "num",
      key: "num",
    },
    {
      title: "长(mm)",
      dataIndex: "length",
      key: "length",
    },
    {
      title: "焊接总长(mm)",
      dataIndex: "totalLength", //动态计算 (length+width)/1000*num
      key: "totalLength",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗电标定值",
      dataIndex: "powerByUnit", //动态计算 固定值
      key: "powerByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "用电量",
      dataIndex: "powers", // 动态计算 totalLength*powerByUnit
      key: "powers",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗CO2量标定值",
      dataIndex: "co2ByUnit", //动态计算 固定值
      key: "co2ByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "耗CO2量(m³)",
      dataIndex: "co2", // 动态计算 totalLength*co2ByUnit
      key: "co2",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  3: [
    ...commonColumns,
    { title: "部件", dataIndex: "device", key: "device" },
    { title: "直径(mm)", dataIndex: "diam", key: "diam" },
    { title: "直管数量", dataIndex: "zgNum", key: "zgNum" },
    { title: "弯管数量", dataIndex: "wgNum", key: "wgNum" },
    { title: "法栏数量", dataIndex: "flNum", key: "flNum" },
    { title: "套管数量", dataIndex: "tgNum", key: "tgNum" },
    { title: "法栏长度", dataIndex: "flLength", key: "flLength" }, //Math.Pi*diam*flNum
    { title: "弯管长度", dataIndex: "wgLength", key: "wgLength" }, //Math.Pi*diam*(wgNum+tgNum+zgNum)
    {
      title: "单位耗电标定值",
      dataIndex: "powerByUnit", //动态计算 固定值
      key: "powerByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "法兰用电量",
      dataIndex: "flPowers", // 动态计算 flLength*powerByUnit
      key: "flPowers",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "弯头管子用电量",
      dataIndex: "wtPowers", // 动态计算 wgLength*powerByUnit
      key: "wtPowers",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  4: [
    ...commonColumns,
    { title: "作业种类", dataIndex: "type", key: "type" },
    { title: "协助拖轮船号", dataIndex: "tug", key: "tug" },
    { title: "协助拖轮功率(HP)", dataIndex: "tugPower", key: "tugPower" },
    { title: "作业消耗油量(L)", dataIndex: "oil", key: "oil" },
    { title: "开始时间", dataIndex: "startTime", key: "startTime" },
    { title: "结束时间", dataIndex: "endTime", key: "endTime" },
    { title: "开始地点", dataIndex: "startPlace", key: "startPlace" },
    { title: "结束地点", dataIndex: "endPlace", key: "endPlace" },
    { title: "备注", dataIndex: "remark", key: "remark" },
  ],
  "5-0": [
    ...commonColumns,
    { title: "领料日期", dataIndex: "pickingDate", key: "pickingDate" },
    { title: "领料部门", dataIndex: "department", key: "department" },
    { title: "事务类型", dataIndex: "type", key: "type" },
    { title: "领用项目编码", dataIndex: "projectCode", key: "projectCode" },
    { title: "领用项目名称", dataIndex: "projectName", key: "projectName" },
    { title: "物料名称", dataIndex: "materialName", key: "materialName" },
    { title: "发货数量", dataIndex: "sendNum", key: "sendNum" },
    { title: "单位", dataIndex: "unit", key: "unit" },
    { title: "供应商", dataIndex: "supplier", key: "supplier" },
  ],
  "5-1": [
    ...commonColumns,
    { title: "过账日期", dataIndex: "postingDate", key: "postingDate" },
    { title: "领料日期", dataIndex: "pickingDate", key: "pickingDate" },
    { title: "出库备注", dataIndex: "remark", key: "remark" },
    { title: "事务类型", dataIndex: "type", key: "type" },
    { title: "领用项目编码", dataIndex: "projectCode", key: "projectCode" },
    { title: "领用项目名称", dataIndex: "projectName", key: "projectName" },
    { title: "库存项目号", dataIndex: "projectNo", key: "projectNo" },
    { title: "物料名称", dataIndex: "materialName", key: "materialName" },
    { title: "物料组", dataIndex: "materialGroup", key: "materialGroup" },
    { title: "发货数量", dataIndex: "sendNum", key: "sendNum" },
    { title: "单位", dataIndex: "unit", key: "unit" },
    { title: "供应商", dataIndex: "supplier", key: "supplier" },
    { title: "工程", dataIndex: "engineering", key: "engineering" },
    { title: "贸易方式", dataIndex: "method", key: "method" },
    { title: "出库类型", dataIndex: "outType", key: "outType" },
  ],
  "6-0": [
    ...commonColumns,
    { title: "施工位置", dataIndex: "place", key: "place" },
    { title: "开始日期", dataIndex: "startTime", key: "startTime" },
    { title: "结束日期", dataIndex: "endTime", key: "endTime" },
    { title: "施工面积(m²)", dataIndex: "area", key: "area" },
    { title: "喷漆次数(度)", dataIndex: "num", key: "num" },
    {
      title: "喷漆面积(m²)",
      dataIndex: "totalArea",
      key: "totalArea",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    }, //动态计算 area*num
    {
      title: "单位耗压缩空气量",
      dataIndex: "airByUnit",
      key: "airByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "压缩空气量",
      dataIndex: "air",
      key: "air",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    }, //动态计算 totalArea * airByUnit
    {
      title: "单位耗天然气量",
      dataIndex: "gasByUnit",
      key: "gasByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "天然气量",
      dataIndex: "gas",
      key: "gas",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    }, //动态计算 totalArea * gasByUnit
    {
      title: "使用电量",
      dataIndex: "powers", //动态计算 子表中所有totalPower累加
      key: "powers",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  "6-1": [
    ...commonColumns,
    { title: "主要工程项目", dataIndex: "project", key: "project" },
    { title: "油漆面积(m²)", dataIndex: "area", key: "area" },
    {
      title: "使用电量",
      dataIndex: "powers", //动态计算 子表中所有totalPower累加
      key: "powers",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗压缩空气量",
      dataIndex: "airByUnit",
      key: "airByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "压缩空气量",
      dataIndex: "air",
      key: "air",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    }, //动态计算 area * airByUnit
    {
      title: "单位耗天然气量",
      dataIndex: "gasByUnit",
      key: "gasByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "天然气量",
      dataIndex: "gas",
      key: "gas",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    }, //动态计算 area * gasByUnit
  ],
  "7-0": [
    ...commonColumns,
    { title: "施工位置", dataIndex: "place", key: "place" },
    { title: "打砂面积(m²)", dataIndex: "area", key: "area" },
    { title: "开始日期", dataIndex: "startTime", key: "startTime" },
    { title: "结束日期", dataIndex: "endTime", key: "endTime" },
    {
      title: "单位耗压缩空气量",
      dataIndex: "airByUnit",
      key: "airByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "压缩空气量",
      dataIndex: "air",
      key: "air",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    }, //动态计算 area * airByUnit
  ],
  "7-1": [
    ...commonColumns,
    { title: "主要工程项目", dataIndex: "project", key: "project" },
    { title: "打砂面积(m²)", dataIndex: "area", key: "area" },
    {
      title: "使用电量",
      dataIndex: "powers", //动态计算 子表中所有totalPower累加
      key: "powers",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗压缩空气量",
      dataIndex: "airByUnit",
      key: "airByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "压缩空气量",
      dataIndex: "air",
      key: "air",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    }, //动态计算 area * airByUnit
  ],
  8: [
    ...commonColumns,
    { title: "工序名称", dataIndex: "type", key: "type" },
    { title: "施工面积(m²)", dataIndex: "area", key: "area" },
    { title: "施工位置", dataIndex: "place", key: "place" },
    {
      title: "使用电量",
      dataIndex: "powers", //动态计算 子表中所有totalPower累加
      key: "powers",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  9: [
    {
      title: "车间",
      dataIndex: "room",
      key: "room",
    },
    { title: "电表", dataIndex: "electricBoxNo", key: "electricBoxNo" },
    {
      title: "消耗电能(KWH)",
      dataIndex: "power",
      key: "power",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    }, // 根据电箱编号+船舶进厂出厂时间范围后端对接电能系统查询的数据
  ],
};

// 工序二级Table
export const innerColumns = {
  0: [
    { title: "电表", dataIndex: "mfid", key: "mfid" },
    { title: "开始时间", dataIndex: "startTime", key: "startTime" },
    { title: "结束时间", dataIndex: "endTime", key: "endTime" },
    {
      title: "总有功电能(KWH)",
      dataIndex: "totalPower",
      key: "totalPower",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    }, //获取电表数据
  ],
  "6-1": [
    { title: "设备", dataIndex: "device", key: "device" },
    { title: "开始时间", dataIndex: "startTime", key: "startTime" },
    { title: "结束时间", dataIndex: "endTime", key: "endTime" },
    { title: "数量", dataIndex: "num", key: "num" },
    { title: "单位", dataIndex: "unit", key: "unit" },
    { title: "设备功率(KW)", dataIndex: "power", key: "power" },
    {
      title: "总有功电能(KWH)",
      dataIndex: "totalPower",
      key: "totalPower",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    }, //动态计算  (endTime-startTime)*num*power*24
  ],
  "7-1": [
    { title: "设备", dataIndex: "device", key: "device" },
    { title: "开始时间", dataIndex: "startTime", key: "startTime" },
    { title: "结束时间", dataIndex: "endTime", key: "endTime" },
    { title: "数量", dataIndex: "num", key: "num" },
    { title: "单位", dataIndex: "unit", key: "unit" },
    { title: "设备功率(KW)", dataIndex: "power", key: "power" },
    {
      title: "总有功电能(KWH)",
      dataIndex: "totalPower",
      key: "totalPower",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    }, //动态计算  (endTime-startTime)*num*power*24
  ],
  8: [
    { title: "电表", dataIndex: "mfid", key: "mfid" },
    { title: "开始时间", dataIndex: "startTime", key: "startTime" },
    { title: "结束时间", dataIndex: "endTime", key: "endTime" },
    {
      title: "总有功电能(KWH)",
      dataIndex: "totalPower",
      key: "totalPower",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
};

/************只有普通船舶才有录入Form表单**************/
// 工序一级Form
const commonItems = [
  {
    type: "hidden",
    name: "id",
  },
  {
    type: "hidden",
    name: "shipRepairId",
  },
];

const rooms = {
  0: "船体车间",
  1: "机电车间",
  2: "船舶车间",
  3: "特涂车间",
  4: "工程车间",
};

export const workFormItems = {
  0: [
    ...commonItems,
    {
      label: "车间",
      type: "select",
      name: "room",
      options: [{ label: rooms[0], value: rooms[0] }],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "钢板重量(吨)",
      type: "number",
      name: "weight",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "单船下料钢板重量(吨)",
      type: "number",
      name: "shipWeight",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  1: [
    ...commonItems,
    {
      label: "车间",
      type: "select",
      name: "room",
      options: [{ label: rooms[0], value: rooms[0] }],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "部件",
      type: "input",
      name: "type",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "厚(mm)",
      type: "number",
      name: "thickness",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "宽(mm)",
      type: "number",
      name: "width",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "数量",
      type: "number",
      name: "num",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "长(mm)",
      type: "number",
      name: "length",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  2: [
    ...commonItems,
    {
      label: "车间",
      type: "select",
      name: "room",
      options: [{ label: rooms[0], value: rooms[0] }],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "类别",
      type: "select",
      name: "weldType",
      span: 12,
      options: [
        { label: "船体焊接", value: "船体焊接" },
        { label: "内场焊接", value: "内场焊接" },
      ],
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "部件",
      type: "input",
      name: "boardType",
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "厚(mm)",
      type: "number",
      name: "thickness",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "宽(mm)",
      type: "number",
      name: "width",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "数量",
      type: "number",
      name: "num",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "长(mm)",
      type: "number",
      name: "length",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  3: [
    ...commonItems,
    {
      label: "车间",
      type: "select",
      name: "room",
      options: [{ label: rooms[1], value: rooms[1] }],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "部件",
      type: "input",
      name: "device",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "直径(mm)",
      type: "number",
      name: "diam",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "直管数量",
      type: "number",
      name: "zgNum",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "弯管数量",
      type: "number",
      name: "wgNum",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "法栏数量",
      type: "number",
      name: "flNum",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "套管数量",
      type: "number",
      name: "tgNum",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  4: [
    ...commonItems,
    {
      label: "车间",
      type: "select",
      name: "room",
      options: [{ label: rooms[2], value: rooms[2] }],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "作业种类",
      type: "select",
      name: "type",
      span: 12,
      options: [
        { label: "进厂", value: "进厂" },
        { label: "出厂", value: "出厂" },
        { label: "移泊", value: "移泊" },
        { label: "进坞", value: "进坞" },
        { label: "出坞", value: "出坞" },
        { label: "协助带缆", value: "协助带缆" },
        { label: "防台顶推", value: "防台顶推" },
        { label: "其它", value: "其它" },
      ],
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "协助拖轮船号",
      type: "input",
      name: "tug",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "协助拖轮功率(HP)",
      type: "number",
      name: "tugPower",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "作业消耗油量(L)",
      type: "number",
      name: "oil",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "开始时间",
      type: "datetime",
      name: "startTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "结束时间",
      type: "datetime",
      name: "endTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "开始地点",
      type: "input",
      name: "startPlace",
      span: 12,
    },
    {
      label: "结束地点",
      type: "input",
      name: "endPlace",
      span: 12,
    },
    {
      label: "备注",
      type: "input",
      name: "remark",
      span: 12,
    },
  ],
  "5-0": [
    ...commonItems,
    {
      label: "车间",
      type: "select",
      name: "room",
      options: [
        { label: rooms[1], value: rooms[1] },
        { label: rooms[4], value: rooms[4] },
      ],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "领料日期",
      type: "date",
      name: "pickingDate",
      span: 12,
    },
    {
      label: "领料部门",
      type: "input",
      name: "department",
      span: 12,
    },
    {
      label: "事务类型",
      type: "input",
      name: "type",
      span: 12,
    },
    {
      label: "领用项目编码",
      type: "input",
      name: "projectCode",
      span: 12,
    },
    {
      label: "领用项目名称",
      type: "input",
      name: "projectName",
      span: 12,
    },
    {
      label: "物料名称",
      type: "input",
      name: "materialName",
      span: 12,
    },
    {
      label: "发货数量",
      type: "number",
      name: "sendNum",
      span: 12,
    },
    {
      label: "单位",
      type: "input",
      name: "unit",
      span: 12,
    },
    {
      label: "供应商",
      type: "input",
      name: "supplier",
      span: 12,
    },
  ],
  "5-1": [
    ...commonItems,
    {
      label: "车间",
      type: "select",
      name: "room",
      options: [{ label: rooms[3], value: rooms[3] }],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "过账日期",
      type: "date",
      name: "postingDate",
      span: 12,
    },
    {
      label: "领料日期",
      type: "date",
      name: "pickingDate",
      span: 12,
    },
    {
      label: "出库备注",
      type: "input",
      name: "remark",
      span: 12,
    },
    {
      label: "事务类型",
      type: "input",
      name: "type",
      span: 12,
    },
    {
      label: "领用项目编码",
      type: "input",
      name: "projectCode",
      span: 12,
    },
    {
      label: "领用项目名称",
      type: "input",
      name: "projectName",
      span: 12,
    },
    {
      label: "库存项目号",
      type: "input",
      name: "projectNo",
      span: 12,
    },
    {
      label: "物料名称",
      type: "input",
      name: "materialName",
      span: 12,
    },
    {
      label: "物料组",
      type: "input",
      name: "materialGroup",
      span: 12,
    },
    {
      label: "发货数量",
      type: "number",
      name: "sendNum",
      span: 12,
    },
    {
      label: "单位",
      type: "input",
      name: "unit",
      span: 12,
    },
    {
      label: "供应商",
      type: "input",
      name: "supplier",
      span: 12,
    },
    {
      label: "工程",
      type: "input",
      name: "engineering",
      span: 12,
    },
    {
      label: "贸易方式",
      type: "input",
      name: "method",
      span: 12,
    },
    {
      label: "出库类型",
      type: "input",
      name: "outType",
      span: 12,
    },
  ],
  "6-0": [
    ...commonItems,
    {
      label: "车间",
      type: "select",
      name: "room",
      options: [{ label: rooms[3], value: rooms[3] }],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "施工位置",
      type: "input",
      name: "place",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "开始日期",
      type: "date",
      name: "startTime",
      span: 12,
    },
    {
      label: "结束日期",
      type: "date",
      name: "endTime",
      span: 12,
    },
    {
      label: "施工面积(m²)",
      type: "number",
      name: "area",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "喷漆次数(度)",
      type: "number",
      name: "num",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  "6-1": [
    ...commonItems,
    {
      label: "车间",
      type: "select",
      name: "room",
      options: [{ label: rooms[3], value: rooms[3] }],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "主要工程项目",
      type: "input",
      name: "project",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "油漆面积(m²)",
      type: "number",
      name: "area",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  "7-0": [
    ...commonItems,
    {
      label: "车间",
      type: "select",
      name: "room",
      options: [{ label: rooms[3], value: rooms[3] }],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "施工位置",
      type: "input",
      name: "place",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "打砂面积(m²)",
      type: "number",
      name: "area",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "开始日期",
      type: "date",
      name: "startTime",
      span: 12,
    },
    {
      label: "结束日期",
      type: "date",
      name: "endTime",
      span: 12,
    },
  ],
  "7-1": [
    ...commonItems,
    {
      label: "车间",
      type: "select",
      name: "room",
      options: [{ label: rooms[3], value: rooms[3] }],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "主要工程项目",
      type: "input",
      name: "project",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "打砂面积(m²)",
      type: "number",
      name: "area",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  8: [
    ...commonItems,
    {
      label: "车间",
      type: "select",
      name: "room",
      options: [{ label: rooms[3], value: rooms[3] }],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "工序名称",
      type: "select",
      name: "type",
      span: 12,
      options: [
        { label: "清洁/冲水", value: "清洁/冲水" },
        { label: "超水除锈", value: "超水除锈" },
      ],
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "施工面积(m²)",
      type: "number",
      name: "area",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "施工位置",
      type: "input",
      name: "place",
      span: 12,
    },
  ],
  9: [
    ...commonItems,
    {
      label: "车间",
      type: "select",
      name: "room",
      options: [{ label: rooms[4], value: rooms[4] }],
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "电表",
      type: "select",
      name: "mfid",
      span: 12,
      options: [],
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
};

// 工序二级Form(由某个一级Table行数据进入，所以带着行pid)
const innerCommonForm = [
  {
    type: "hidden",
    name: "id",
  },
  {
    type: "hidden",
    name: "pid",
  },
];
export const innerFormItems = {
  0: [
    ...innerCommonForm,
    // {
    //   label: "设备型号",
    //   type: "input",
    //   name: "deviceNo",
    //   span: 12,
    //   rules: [
    //     {
    //       required: true,
    //       message: "必填",
    //     },
    //   ],
    // },
    {
      label: "电表",
      type: "select",
      name: "mfid",
      span: 12,
      options: [],
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "开始时间",
      type: "datetime",
      name: "startTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "结束时间",
      type: "datetime",
      name: "endTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  "6-1": [
    ...innerCommonForm,
    {
      label: "设备",
      type: "input",
      name: "device",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "开始时间",
      type: "datetime",
      name: "startTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "结束时间",
      type: "datetime",
      name: "endTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "数量",
      type: "number",
      name: "num",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "单位",
      type: "input",
      name: "unit",
      span: 12,
    },
    {
      label: "功率",
      type: "number",
      name: "power",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  "7-1": [
    ...innerCommonForm,
    {
      label: "设备",
      type: "input",
      name: "device",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "开始时间",
      type: "datetime",
      name: "startTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "结束时间",
      type: "datetime",
      name: "endTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "数量",
      type: "number",
      name: "num",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "单位",
      type: "input",
      name: "unit",
      span: 12,
    },
    {
      label: "功率",
      type: "number",
      name: "power",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
  8: [
    ...innerCommonForm,
    // {
    //   label: "设备",
    //   type: "input",
    //   name: "device",
    //   span: 12,
    //   rules: [
    //     {
    //       required: true,
    //       message: "必填",
    //     },
    //   ],
    // },
    {
      label: "电表",
      type: "select",
      name: "mfid",
      span: 12,
      options: [],
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "开始时间",
      type: "datetime",
      name: "startTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
    {
      label: "结束时间",
      type: "datetime",
      name: "endTime",
      span: 12,
      rules: [
        {
          required: true,
          message: "必填",
        },
      ],
    },
  ],
};

/***************************工序及子工序***************************/
